﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IceCS.TestModels.Drink
{
    public class CupOfCoffee:IHotDrink,IDisposable
    {
        private byte sugar;
        /// <summary>
        /// 咖啡豆类别
        /// </summary>
        public string BeanType { get; set; }
        /// <summary>
        /// 是否是速溶咖啡
        /// </summary>
        public bool Instant { get; set; }
        /// <summary>
        /// 是否包含牛奶
        /// </summary>
        public bool Milk { get; set; }
        /// <summary>
        /// 方糖数量
        /// </summary>
        public byte Sugar
        {
            get
            {
                return sugar;
            }
            set
            {
                if (value < 5)
                {
                    sugar = value;
                }
            }
        }
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// class author
        /// </summary>
        /// <remarks>2017年7月12日22:43:04</remarks>
        public static string ClassAuthor = "Ice Dog";

        public CupOfCoffee()
        {

        }
        /// <summary>
        /// default ctor
        /// </summary>
        public CupOfCoffee(byte sugarCount)
        {
            this.Sugar = sugarCount;
        }
        /// <summary>
        /// default destory
        /// </summary>
        ~CupOfCoffee()
        {

        }

        public byte AddSugar(byte amount)
        {
            this.Sugar = amount;
            return amount;
        }

        public static CupOfCoffee Create()
        {
            return new CupOfCoffee();
        }

        public void Dispose()
        {
            Console.Write("dispose");
        }
    }
}
